package com.example.superyi;

import androidx.appcompat.app.AppCompatActivity;

import android.os.Bundle;
import android.util.Log;
import android.widget.TextView;

import com.example.superyi.myteam.R;
import com.example.superyi.myteam.myAnswer.INetCallback;
import com.example.superyi.myteam.myAnswer.OkHttpUtils;
import com.google.gson.Gson;

public class TestActivity extends AppCompatActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_test);

        OkHttpUtils.getInstance().get(new INetCallback() {
            @Override
            public void onSuccess(String response) {
                Gson gson = new Gson();
//                List<Msg.DataBean> dataBeans = gson.fromJson(response, Msg.class).getData();
//                Log.e("TAG", "onSuccess: " + dataBeans);
//                dataBeanList.addAll(dataBeans);
//                mAdapter.notifyDataSetChanged();
                byte[] s = gson.fromJson(response, PostingsTest.class).getTest();
                Log.e("TAG","onSuccess"+response);

                TextView textView = findViewById(R.id.textView);
                textView.setText(String.valueOf(s));
            }

            @Override
            public void onFailed(Throwable e) {
                Log.e("TAG", "onFailed: " + e);
            }
        },"http://49.232.60.155:8080/zzuStuPostBar0.0.5/ReadPosting_Test");
    }
}